
#include "devTim.h"
#include "devBuzzer.h"

#include "funcDelay.h"

void buzzer_init(void)
{
  tim2_dev_init();
  buzzer_dev_init();
}

void buzzer_on(void)
{
	TIM_Cmd(TIM2, ENABLE);
}

void buzzer_off(void)
{
	TIM_Cmd(TIM2, DISABLE);
  buzzer_dev_set(BUZZER_HIGH_LEVEL);
}

void buzzer_ring(unsigned int uiCount)
{
	int i;
	for(i=0; i<uiCount; i++){
		buzzer_on();
		func_timing_delay(100);
		buzzer_off();
		func_timing_delay(100);
	}
}



